<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <title>看帖</title>
</head>
<style>
    /* 页面布局 */
    .allPosts{
        height: 70%;
        margin-left: 2px;
        margin-right: 2px;
    }    
    .footer{
        width: 100%;
        text-align: center;
        position: fixed;
        bottom: 0;
        background-color: beige;
    }
    /* 页脚设计 */
        /* 页码样式 */
    ul.pagination {
        display: inline-block;
        padding: 0;
        margin: 0;
    }
    ul.pagination li {
        display: inline;
    }
    ul.pagination li a {
        color: black;
        float: left;
        padding: 8px 16px;
        text-decoration: none;
        transition: background-color .3s;
        border: 1px solid #ddd;
    }
    .pagination li:first-child a {
        border-top-left-radius: 5px;
        border-bottom-left-radius: 5px;
    }
    .pagination li:last-child a {
        border-top-right-radius: 5px;
        border-bottom-right-radius: 5px;
    }
    ul.pagination li a.active {
        background-color: #4CAF50;
        color: white;
        border: 1px solid #4CAF50;
    }
    ul.pagination li a:hover:not(.active) {
        background-color: #ddd;
    }
    /* 回复表单 */
    .footer>form{
        height: 80px;
    }
    #reply-text{
        margin-top: 5px;
        width: 60%;
        height: 70px;
        border-radius: 8px;
    }
    #reply-button{
        width: 10%;
        height: 70px;
        border-radius: 8px;
    }
    
    /* 单个帖子设计 */
    .post{
        margin-top: 2px;
        width: 100%;
        height: 150px;
        border: #bdbdbd solid 2px;
        border-radius: 8px;
        background-color:whitesmoke
    }
    .part-1{
        width: 100%;
        height: 25%;
    }
    .userHead{
        float: left;
        text-align: center;
        width: 10%;
        height: 100%;
        margin-top: -1px;
    }
    .user{
        margin-left: 2px;
        float: left;
        text-align: left;
        line-height: 200%;
        width: 80%;
        height: 100%;
    }
    .record-button{
        float: left;
        width: 8%;
    }
    .record-button>button{
        margin-top: 3px;
        margin-left: 8px;
        width: 100%;
        border: gainsboro solid 2px;
        border-radius: 8px;
    }
    .part-2{
        width: 100%;
        height: 15%;
    }
    .post-title{
        float: left;
        font-weight: bold;
    }
    .part-3{
        width: 100%;
        height: 60%;
    }
    .post-text{
        width: 100%;
        float: left;
        font-size: 16px;
        
    }
    .seg{
        width: 100%;
        height: 1px;
        background-color: #bdbdbd;
    }

</style>
<body>
    <!-- 全部帖子 -->
    <div class="allPosts"> 
        <!-- 每个帖子 -->
        <div class="post" id="post-1">
            <div class="part-1">
                <div class="userHead">
                    <img src="../img/user.png" alt="userHead" style="width: 39px;"> 
                </div>
                <div class="user">
                    <p>氵之大帝</p>
                </div>
                <div class="record-button">
                    <button type="submit" name="reply-post">@</button>
                </div>
            </div>
            <div class="seg"></div>

            <div class="part-2">
                <div class="post-title">
                    <p>探讨氵贴的重要性</p>
                </div>
            </div>
            <div class="seg"></div>
            
            <div class="part-3">
                <div class="post-text" text-justify pre-scrollable>
                    <p>众所周知, 氵贴有助于身心健康...</p>
                </div>
            </div>
        </div>

    </div>
    <div class="footer">
        <form action="#">
            <input id="reply-text" type="text" placeholder="留下精彩的回复">
            <input id="reply-button" type="button" value="回复" onclick="insertFun()">
        </form>
        <!-- 页码 -->
        <div class="page">
            <ul class="pagination">
                <li><a href="#">«</a></li>
                <li><a href="#" class="active" >1</a></li>
                <li><a href="#">2</a></li>
                <li><a href="#">3</a></li>
                <li><a href="#">4</a></li>
                <li><a href="#">5</a></li>
                <li><a href="#">6</a></li>
                <li><a href="#">7</a></li>
                <li><a href="#">»</a></li>
            </ul>
        </div>
    </div>
</body>

<script>
/*     var postCounter = 1;
    function insertFun(){
        var vtop = "插入post的上面";
        var lastPost = document.getElementById("post-1");
        var newPost = document.createElement("div");
        var newPart_1
        newPost.setAttribute("class","post");

        newPost.innerHTML=vtop;
        lastPost.parentNode.insertBefore(newPost,lastPost);
    } */
</script>
</html>